<template>
  <div>
   <p v-color ='col'>hello</p>
  
  <input type="text" v-focus>
  <my-left :uname ='uname' ></my-left>
  </div>
</template>

<script>

import MyLeft from './components/MyLeft.vue'

export default {
  components: { MyLeft,},
  
  data () {
    return {
    col:'#90b',
    uname:'lisi'
    }
  },
  directives:{
    color:{
      bind(el,obj){
        el.style.color = obj.value
      },
      update(el,obj){
        el.style.color = obj.value
      }
    },
    focus:{
      inserted(el){
        el.focus()
      }
    }
  }
 
}

</script>

<style>

</style>